//
//  ChargeStateView.m
//  aiteshangcheng
//
//  Created by caominglei on 2018/4/24.
//  Copyright © 2018年 aite. All rights reserved.
//

#import "ChargeStateView.h"
#import "NoHighlightButton.h"
#import "UIImage+Category.h"

@implementation ChargeStateView


- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor groupTableViewBackgroundColor];
        [self createSubviews];
        
    }
    return self;
}

- (void)createSubviews

{
    NSArray *titleArray = @[@"充值单号",@"创建时间",@"支付方式",@"充值金额",@"状态",@"操作"];
    for (int i = 0; i < titleArray.count; i++) {
        NoHighlightButton *selectedBtn = [NoHighlightButton buttonWithType:UIButtonTypeCustom];
        CGFloat btnW = kScreenWidth/titleArray.count;
        CGFloat btnX = i * btnW;
        selectedBtn.frame = rect(btnX, 1, btnW, 40);
        selectedBtn.tag = 1510+i;
        selectedBtn.titleLabel.font = [UIFont systemFontOfSize:12];
        [selectedBtn setTitle:titleArray[i] forState:UIControlStateNormal];
        [selectedBtn setBackgroundImage:[UIImage createImageWithColor:[UIColor groupTableViewBackgroundColor]] forState:UIControlStateNormal];
        [selectedBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];        //        selectedBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
        selectedBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
        selectedBtn.titleLabel.font = [UIFont systemFontOfSize:10];
        [self addSubview:selectedBtn];
        
    }
}

@end
